package com.uppfind.framework.dao.mybatis.generator.generator.config.rules;

/**
 * 表字段类型
 * Created by xuliugen on 2017/7/6.
 */
public enum DBColumnType {

    // 基本类型
    MYSQL_BASE_INT("int", null, "INTEGER"),
    MYSQL_BASE_BOOLEAN("boolean", null, "BOOLEAN"),
    MYSQL_BASE_FLOAT("float", null, "FLOAT"),
    MYSQL_BASE_DOUBLE("double", null, "DOUBLE"),
    // 包装类型
    MYSQL_STRING("String", null, "VARCHAR"),
    MYSQL_LONG("Long", null, null),
    MYSQL_BIGINT("Long", null, "BIGINT"),
    MYSQL_INTEGER("Integer", null, "INTEGER"),
    MYSQL_FLOAT("Float", null, "FLOAT"),
    MYSQL_DOUBLE("Double", null, "DOUBLE"),
    MYSQL_BOOLEAN("Boolean", null, "BOOLEAN"),
    MYSQL_BYTE_ARRAY("byte[]", null, "BLOG"),
    MYSQL_CHARACTER("String", null, "CHAR"),
    MYSQL_DATE("java.util.Date", "java.util.Date", "DATE"),
    MYSQL_TIME("java.util.Date", "java.util.Date", "TIME"),
    MYSQL_TIMESTAMP("java.util.Date", "java.util.Date", "TIMESTAMP"),


    // 基本类型
    POSTGRESQL_BASE_INT("int", null, "INTEGER"),
    POSTGRESQL_BASE_BOOLEAN("boolean", null, "BOOLEAN"),
    POSTGRESQL_BASE_FLOAT("float", null, "FLOAT"),
    POSTGRESQL_BASE_DOUBLE("double", null, "DOUBLE"),
    // 包装类型
    POSTGRESQL_STRING("String", null, "VARCHAR"),
    POSTGRESQL_LONG("Long", null, null),
    POSTGRESQL_BIGINT("Long", null, "BIGINT"),
    POSTGRESQL_INTEGER("Integer", null, "INTEGER"),
    POSTGRESQL_FLOAT("Float", null, "FLOAT"),
    POSTGRESQL_DOUBLE("Double", null, "DOUBLE"),
    POSTGRESQL_BOOLEAN("Boolean", null, "BOOLEAN"),
    POSTGRESQL_BYTE_ARRAY("byte[]", null, "BLOG"),
    POSTGRESQL_CHARACTER("String", null, "CHAR"),
    POSTGRESQL_DATE("java.util.Date", "java.util.Date", "DATE"),
    POSTGRESQL_TIME("java.util.Date", "java.util.Date", "TIME"),
    POSTGRESQL_TIMESTAMP("java.util.Date", "java.util.Date", "TIMESTAMP"),

    // 基本类型
    SQLSERVER_BASE_INT("int", null, "INTEGER"),
    SQLSERVER_BASE_BOOLEAN("boolean", null, "BOOLEAN"),
    SQLSERVER_BASE_FLOAT("float", null, "FLOAT"),
    SQLSERVER_BASE_DOUBLE("double", null, "DOUBLE"),
    // 包装类型
    SQLSERVER_STRING("String", null, "VARCHAR"),
    SQLSERVER_LONG("Long", null, null),
    SQLSERVER_BIGINT("Long", null, "BIGINT"),
    SQLSERVER_INTEGER("Integer", null, "INTEGER"),
    SQLSERVER_FLOAT("Float", null, "FLOAT"),
    SQLSERVER_DOUBLE("Double", null, "DOUBLE"),
    SQLSERVER_BOOLEAN("Boolean", null, "BOOLEAN"),
    SQLSERVER_BYTE_ARRAY("byte[]", null, "BLOG"),
    SQLSERVER_CHARACTER("String", null, "CHAR"),
    SQLSERVER_DATE("java.util.Date", "java.util.Date", "DATE"),
    SQLSERVER_TIME("java.util.Date", "java.util.Date", "TIME"),
    SQLSERVER_TIMESTAMP("java.util.Date", "java.util.Date", "TIMESTAMP"),

    // 基本类型
    ORACLE_BASE_INT("int", null, "INTEGER"),
    ORACLE_BASE_BOOLEAN("boolean", null, "BOOLEAN"),
    ORACLE_BASE_FLOAT("float", null, "FLOAT"),
    ORACLE_BASE_DOUBLE("double", null, "DOUBLE"),
    // 包装类型
    ORACLE_STRING("String", null, "VARCHAR"),
    ORACLE_LONG("Long", null, null),
    ORACLE_BIGINT("Long", null, "BIGINT"),
    ORACLE_INTEGER("Integer", null, "INTEGER"),
    ORACLE_FLOAT("Float", null, "FLOAT"),
    ORACLE_DOUBLE("Double", null, "DOUBLE"),
    ORACLE_BOOLEAN("Boolean", null, "BOOLEAN"),
    ORACLE_BYTE_ARRAY("byte[]", null, "BLOG"),
    ORACLE_CHARACTER("String", null, "CHAR"),
    ORACLE_DATE("java.util.Date", "java.util.Date", "DATE"),
    ORACLE_TIME("java.util.Date", "java.util.Date", "TIME"),
    ORACLE_TIMESTAMP("java.util.Date", "java.util.Date", "TIMESTAMP");

    /**
     * javaType类型
     */
    private final String javaType;

    /**
     * 包路径
     */
    private final String pkg;

    /**
     * jdbcType类型
     */
    private final String jdbcType;

    DBColumnType(final String type, final String pkg, final String jdbcType) {
        this.javaType = type;
        this.pkg = pkg;
        this.jdbcType = jdbcType;
    }

    public String getJavaType() {
        return this.javaType;
    }

    public String getPkg() {
        return this.pkg;
    }

    public String getJdbcType() {
        return this.jdbcType;
    }
}
